<template>
  <div>
    登录组件
    <button @click="getLogin"> 点击发送请求</button>

    <button @click="getUsers"> 点击 getUsers</button>
    <button @click="getGoods"> 点击 getGoods</button>


  </div>
</template>

<script  setup>

import { getLoginApi, getUserApi, getGoodsApi } from '../request/api'


//  登录的接口定义
const getLogin = () => {
  getLoginApi({ username: 'admin', password: 123456 }).then(res => {
    console.log(res)

  })
}



/**
 * // 获取用户的接口定义
 *  pagenum    type  Number    
 *   pagesize  type  Number   
 *   return    type  Array  
 * 
 * 
 */
const getUsers = async () => {
  let res = await getUserApi({ pagenum: 1, pagesize: 15 })

  console.log(res)
}



/*
//  获取商品的接口

*  pagenum    type  Number    
 *   pagesize  type  Number   
 *   return    type  Array  
 * 
 **/


const getGoods = async () => {
  let res = await getGoodsApi({ pagenum: 1, pagesize: 15 })

  console.log(res)
}


</script>

<style lang="scss" scoped></style>